<HTML><HEAD><TITLE>get_chtab(+Char, -Class)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Syntax Settings</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>get_chtab(+Char, -Class)</H1>
Succeeds if the lexical class of character Char is Class.


<DL>
<DT><EM>Char</EM></DT>
<DD>Integer in the range 0 to 255.
</DD>
<DT><EM>Class</EM></DT>
<DD>Atom giving class name or variable.
</DD>
</DL>
<H2>Description</H2>
   Retrieves or checks the lexical class of a given character.

<P>
   Class is unified with the current lexical character class of Char.

<P>
   Char must be an integer in the range 0 to 255 (an escaped ASCII code is
   also acceptable, eg 0'a = 98).

<P>
   The following table lists the character classes and the corresponding
   default characters:

<P>
<PRE>
 Class          Default member characters
---------------------------------------------------------
 upper_case     all upper case letters
 underline      _
 lower_case     all lower case letters
 digit          digits
 blank_space    space, tab and nonprintable characters
 end_of_line    newline (NL)
 atom_quote     '
 string_quote   "
 list_quote
 radix
 ascii
 solo           ! ;
 special        ( [ { ) ] } , |
 line_comment   %
 escape         \
 first_comment  /
 second_comment *
 symbol         # + - . : &lt; = &gt; ? @ ^ ` ~ &amp; $
 terminator
</PRE>

<H3>Modes and Determinism</H3><UL>
<LI>get_chtab(+, -) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Char in not instantiated.
<DT><EM>(5) type error </EM>
<DD>Char is not an ASCII code.
<DT><EM>(6) out of range </EM>
<DD>Char is not in the range 0 to 255.
</DL>
<H2>Examples</H2>
<PRE>
Success:
   [eclipse]: get_chtab(0'a,X).

   X = lower_case
   yes.
   [eclipse]: get_chtab(60,X).

   X = symbol
   yes.
   [eclipse]:

Fail:
   get_chtab(98,symbol).
   get_chtab(98,blah).

Error
   get_chtab(X,lower_case).     (Error 4).
   get_chtab("a",X).            (Error 5).
   get_chtab(-1,X).             (Error 6).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/syntax/set_chtab-2.html">set_chtab / 2</A>, <A HREF="../../kernel/iochar/read_token-2.html">read_token / 2</A>, <A HREF="../../kernel/iochar/read_token-3.html">read_token / 3</A>
</BODY></HTML>
